package com.yanqu.road.server.manger.activity.recycle;

import com.yanqu.road.entity.activity.ActivityItemRecycleData;
import com.yanqu.road.entity.activity.ruishou.RuiShouConfig;
import com.yanqu.road.entity.enums.eActivityType;
import com.yanqu.road.logic.helper.ActivityHelper;
import com.yanqu.road.server.manger.activity.ruishou.RuiShouMgr;

import java.util.ArrayList;
import java.util.List;

public class RuiShouRecycleStrategy extends AbstractItemRecycleStrategy  {
    @Override
    public void markNeedRecycleItem() {
        RuiShouConfig config = RuiShouMgr.getConfig();
        if (config != null && ActivityHelper.activityInShowTime(config.getActivityInfo())) {
            if (config != null) {
                int itemId = config.getRuiShouCostItemId();
                int scoreItemId = config.getRuiShouScoreItemId();

                long recycleTime = config.getActivityInfo().getEndShowTime() * 1000L + gapTime;

                //标记体力道具
                List<String> paramList = new ArrayList<>();
                paramList.add(String.valueOf(itemId));
                paramList.add(String.valueOf(scoreItemId));
                paramList.add("2");
                paramList.add(config.getActivityInfo().getActivityName());

                ActivityItemRecycleMgr.addRecycleItemData(itemId, activityType, 1, recycleTime, paramList);
            }
        }
    }

    @Override
    protected void initActivityType() {
        activityType = eActivityType.RuiShou.getValue();
    }

    @Override
    protected void doRecycle(long userId, ActivityItemRecycleData data) {
        item2Score(userId, data);
    }

    @Override
    public boolean isActivityRunning() {
        return false;
    }
}
